<template>
    <div>
        <el-table :data="tableData" show-selection @selection-change="handleSelectionChange">
            <el-table-column type="selection"></el-table-column>
            <el-table-column prop="name" label="姓名"></el-table-column>
            <el-table-column prop="age" label="年龄"></el-table-column>
            <el-table-column prop="gender" label="性别"></el-table-column>
        </el-table>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                tableData: [
                    { name: '张三', age: 20, gender: '男' },
                    { name: '李四', age: 25, gender: '女' },
                    { name: '王五', age: 30, gender: '男' },
                    { name: '赵六', age: 35, gender: '女' }
                ],
                selectedRows: []
            };
        },
        methods: {
            handleSelectionChange(selection) {
                this.selectedRows = selection;
                console.log(this.selectedRows,11)
            }
        }
    };
</script>
